﻿using JustMetClient.Launch.Commons;
using Azylee.Core.AppUtils;
using Azylee.Core.DataUtils.DateTimeUtils;
using Azylee.Core.IOUtils.TxtUtils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace JustMetClient.Launch.Helpers
{
    public static class InstallHelper
    {
        /// <summary>
        /// 对新装版本进行处理
        /// </summary>
        public static void NewInstall()
        {
            //是否初始装备（新装或新版本覆盖安装）
            bool initialAssembly = IniTool.GetBool(R.Files.Install, "Installation", "NewInstall", false);
            if (initialAssembly)
            {
                //取消新装版本标记
                IniTool.Set(R.Files.Install, "Installation", "NewInstall", false);

                //标记最新安装日期
                IniTool.Set(R.Files.Datas, "Installation", "LastInstallDate", DateTimeConvert.StandardString(DateTime.Now));

                //移除AppData中的指定运行版本（JustMetClient-New）
                IniTool.Set(R.Files.Datas, "Version", "JustMetClient-New", R.NoNewVersion);
                
            }
        }
    }
}
